home *** CD-ROM | disk | FTP | other *** search
/ Gamers Delight 2 / Gamers Delight 2.iso / Aminet / game / wb / PopLife.lha / PopLife / crash.c < prev    next >
C/C++ Source or Header  |  1987-11-15  |  794b  |  31 lines

  1. /* An attempt to close the Output() file provided by the CLI. */
  2. /* It is not more than that - it doesn't work (Guru FreeTwice from DOS) */
  3.  
  4. extern struct CommandLineInterface *_argcli;
  5.  
  6. /* extern long Input(), Output(), FindTask(), IsInteractive, Open(), Close(); */
  7.  
  8. main()
  9. {
  10.     long output, stdout, curout, nil;
  11.     struct Process *proc;
  12.  
  13.     output = Output();
  14.     curout = _argcli->cli_CurrentOutput;
  15.     stdout = _argcli->cli_StandardOutput;
  16.     proc   = FindTask(0L);
  17.  
  18.     if (_argcli->cli_Background && IsInteractive(stdout)) {
  19.         Write(output, "Opening NIL:\n",  13L);
  20.         nil = Open("NIL:", MODE_OLDFILE);
  21.         Close(stdout);
  22.         _argcli->cli_StandardOutput = nil;
  23.         if (curout == stdout)
  24.             _argcli->cli_CurrentOutput = nil;
  25.         if (output == stdout) {
  26.             proc->pr_COS = nil;
  27.         }
  28.         proc->pr_ConsoleTask = 0;
  29.     }
  30. }
  31.